home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / GRAPHICS / POV_3 / SCENES / ADVANCED / SHAPE.POV < prev    next >
Encoding:
Text File  |  2005-03-03  |  11.9 KB  |  352 lines

  1. /*
  2.          ARCHIMEDEAN SOLIDS for POV-Ray 2.2
  3.          ==================================
  4.       Constructed by Grant Hutchison [100047,144]  
  5. Much data and encouragement from Tom Gettys [72730,2013]
  6. Other data from "Polyhedron Models" by Magnus Wenninger
  7.  
  8. Archimedean solids are solid shapes whose faces are all
  9. regular polygons of two or more kinds, and whose vertices 
  10. are all identical. There are 13 different kinds. Two (the 
  11. snub cube and snub dodecahedron) come in paired mirror- 
  12. image forms. The others can be formed by simple truncation 
  13. (chopping the corners off) of simpler solids. All have 
  14. pleasingly symmetrical crystalline forms, and are declared 
  15. below.
  16.  
  17. They are:
  18.  
  19.  Truncated_Tetrahedron
  20.    8 sides (4 triangles, 4 hexagons)
  21.  
  22.  Truncated_Cube
  23.    14 sides (8 triangles, 6 octagons)
  24.  Truncated_Octahedron
  25.    14 sides (6 squares, 8 hexagons)
  26.  Cuboctahedron
  27.    14 sides (8 triangles, 6 squares)
  28.  
  29.  Truncated_Dodecahedron
  30.    32 sides (20 triangles, 12 dodecagons) - soccer ball pattern
  31.  Truncated_Icosahedron
  32.    32 sides (12 pentagons, 20 hexagons) - soccer ball / fullerene shape
  33.  Icosidodecahedron
  34.    32 sides (20 triangles, 12 pentagons)
  35.  
  36.  Small_Rhombicuboctahedron
  37.    26 sides (8 triangles, 18 squares)
  38.  Great_Rhombicuboctahedron
  39.    26 sides (12 squares, 8 hexagons, 6 octagons)
  40.    
  41.  Small_Rhombicosidodecahedron
  42.    62 sides (20 triangles, 30 squares, 12 pentagons)
  43.  Great_Rhombicosidodecahedron
  44.    62 sides (30 squares, 20 hexagons, 12 dodecagons)
  45.  
  46.  Snub_Cube
  47.    38 sides (32 triangles, 6 squares) - two mirror-image forms
  48.  Snub_Dodecahedron
  49.    92 sides (80 triangles, 12 pentagons) - two mirror-image forms
  50.  
  51. Two rhombic polyhedra are also declared. These are
  52. regular solids whose faces are all identical diamond shapes. 
  53. They are needed for some of the truncations.
  54.  
  55. They are:
  56.  
  57.  Rhombic_Dodecahedron 
  58.    12 faces - like a garnet crystal
  59.  Rhombic_Triacontahedron
  60.    30 faces - complex, interesting appearance
  61.  
  62. Also declared are SnubSquarePyramid and SnubPentPyramid,
  63. needed for the formation of the two snubs, and, at the start, 
  64. some basic unit polyhedra similar to those from shapes2.inc,
  65. created by Tom Price.
  66. Like Tom Price's Platonic solids, all the solids below
  67. are scaled to have unit internal spheres: in each case,
  68. the largest faces of the solid lie one unit from the
  69. origin, so that the unscaled, undisplaced solid could rest
  70. one of its largest faces on a horizontal plane at y = -1.
  71. The various component polyhedra have been coloured, to
  72. highlight the construction of the Archimedeans by
  73. intersection of Platonic solids.
  74. */
  75.  
  76. #include "colors.inc"
  77.  
  78. //UNIT SOLIDS
  79. //These solids are based on those created by Tom Price
  80. //for the shapes2.inc file, but some of the angles and
  81. //orientations are different.
  82.  
  83. #declare Unit_Cube =
  84.   box { <-1, -1, -1>, <1, 1, 1> pigment {color Blue}}
  85.  
  86. #declare Unit_Octahedron = 
  87. intersection {
  88.   plane { -z, 1 rotate <35.264390, 45, 0> }
  89.   plane { -z, 1 rotate <35.264390, 135, 0> }
  90.   plane { -z, 1 rotate <35.264390, 225, 0> }
  91.   plane { -z, 1 rotate <35.264390, 315, 0> }
  92.   plane { -z, 1 rotate <-35.264390, 45, 0> }
  93.   plane { -z, 1 rotate <-35.264390, 135, 0> }
  94.   plane { -z, 1 rotate <-35.264390, 225, 0> }
  95.   plane { -z, 1 rotate <-35.264390, 315, 0> }
  96.   pigment {color White}
  97. }
  98.  
  99. #declare Unit_Dodecahedron =
  100. intersection {
  101.   plane { -z, 1 rotate <26.565051, 36, 0> }
  102.   plane { -z, 1 rotate <26.565051, 108, 0> }
  103.   plane { -z, 1 rotate <26.565051, 180, 0> }
  104.   plane { -z, 1 rotate <26.565051, 252, 0> }
  105.   plane { -z, 1 rotate <26.565051, 324, 0> }
  106.   plane { -z, 1 rotate <-26.565051, 0, 0> }
  107.   plane { -z, 1 rotate <-26.565051, 72, 0> }
  108.   plane { -z, 1 rotate <-26.565051, 144, 0> }
  109.   plane { -z, 1 rotate <-26.565051, 216, 0> }
  110.   plane { -z, 1 rotate <-26.565051, 288, 0> }
  111.   plane { -z, 1 rotate -90*x }
  112.   plane { -z, 1 rotate 90*x }
  113.   pigment {color Red}
  114. }
  115.  
  116. #declare Unit_Icosahedron =
  117. intersection {
  118.   plane { -z, 1 rotate <52.622632, 0, 0> }
  119.   plane { -z, 1 rotate <52.622632, 72, 0> }
  120.   plane { -z, 1 rotate <52.622632, 144, 0> }
  121.   plane { -z, 1 rotate <52.622632, 216, 0> }
  122.   plane { -z, 1 rotate <52.622632, 288, 0> }
  123.   plane { -z, 1 rotate <10.812317, 0, 0> }
  124.   plane { -z, 1 rotate <10.812317, 72, 0> }
  125.   plane { -z, 1 rotate <10.812317, 144, 0> }
  126.   plane { -z, 1 rotate <10.812317, 216, 0> }
  127.   plane { -z, 1 rotate <10.812317, 288, 0> }
  128.   plane { -z, 1 rotate <-10.812317, 36, 0> }
  129.   plane { -z, 1 rotate <-10.812317, 108, 0> }
  130.   plane { -z, 1 rotate <-10.812317, 180, 0> }
  131.   plane { -z, 1 rotate <-10.812317, 252, 0> }
  132.   plane { -z, 1 rotate <-10.812317, 324, 0> }
  133.   plane { -z, 1 rotate <-52.622632, 36, 0> }
  134.   plane { -z, 1 rotate <-52.622632, 108, 0> }
  135.   plane { -z, 1 rotate <-52.622632, 180, 0> }
  136.   plane { -z, 1 rotate <-52.622632, 252, 0> }
  137.   plane { -z, 1 rotate <-52.622632, 324, 0> }
  138.   pigment {color Green}
  139. }
  140.  
  141.  
  142. //RHOMBIC POLYHEDRA
  143.  
  144. #declare Rhombic_Dodecahedron = 
  145. intersection {
  146.   box { <-1, -1, -2>, <1, 1, 2> rotate 45*z }
  147.   box { <-1, -2, -1>, <1, 2, 1> rotate 45*y }
  148.   box { <-2, -1, -1>, <2, 1, 1> rotate 45*x }
  149.   pigment {color Yellow}
  150.   bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  151. }
  152.  
  153. #declare Rhombic_Triacontahedron =
  154. intersection {  
  155.   box { <-1, -1, -1>, <1, 1, 1> rotate <31.717474, 0, 0> }
  156.   box { <-1, -1, -1>, <1, 1, 1> rotate <31.717474, 72, 0> }
  157.   box { <-1, -1, -1>, <1, 1, 1> rotate <31.717474, 144, 0> }
  158.   box { <-1, -1, -1>, <1, 1, 1> rotate <31.717474, 216, 0> }
  159.   box { <-1, -1, -1>, <1, 1, 1> rotate <31.717474, 288, 0> }
  160.   pigment {color Yellow}
  161.   bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  162. }
  163.  
  164.  
  165. //ARCHIMEDEAN TRUNCATED SOLIDS 
  166.  
  167. #declare Truncated_Tetrahedron =
  168. intersection {
  169.    plane { -y, 0.75 pigment {color Cyan} }
  170.    plane { -z, 0.75 rotate <19.471221, 0, 0> pigment {color Cyan} }
  171.    plane { -z, 0.75 rotate <19.471221, 120, 0> pigment {color Cyan} }
  172.    plane { -z, 0.75 rotate <19.471221, 240, 0> pigment {color Cyan} }
  173.    plane { y, 1.25 pigment {color Magenta} } 
  174.    plane { -z, 1.25 rotate <-19.471221, 60, 0> pigment {color Magenta} }
  175.    plane { -z, 1.25 rotate <-19.471221, 180, 0> pigment {color Magenta} }
  176.    plane { -z, 1.25 rotate <-19.471221, 300, 0> pigment {color Magenta} }
  177.    translate -0.25*y
  178.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  179. }
  180.  
  181. #declare Truncated_Cube =
  182. intersection {
  183.   object { Unit_Cube }
  184.   object { Unit_Octahedron scale <1.393847, 1.393847, 1.393847> }
  185.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  186. }
  187.  
  188. #declare Truncated_Octahedron =
  189. intersection {
  190.   object { Unit_Octahedron }
  191.   object { Unit_Cube scale <1.154700, 1.154700, 1.154700> }
  192.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  193. }
  194.  
  195. #declare Cuboctahedron =
  196. intersection {
  197.   object { Unit_Cube }
  198.   object { Unit_Octahedron scale <1.154700, 1.154700, 1.154700> }
  199.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  200. }
  201.  
  202. #declare Truncated_Dodecahedron =
  203. intersection {
  204.   object { Unit_Dodecahedron }
  205.   object { Unit_Icosahedron scale <1.169840, 1.169840, 1.169840> }
  206.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  207. }
  208.  
  209. #declare Truncated_Icosahedron =
  210. intersection {
  211.   object { Unit_Icosahedron }
  212.   object { Unit_Dodecahedron scale <1.026626, 1.026626, 1.026626> }
  213.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  214. }
  215.  
  216. #declare Icosidodecahedron =
  217. intersection {
  218.   object { Unit_Dodecahedron }
  219.   object { Unit_Icosahedron scale <1.098014, 1.098014, 1.098014> }
  220.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  221. }
  222.  
  223. #declare Small_Rhombicuboctahedron =
  224. intersection {
  225.   object { Unit_Cube }
  226.   object { Rhombic_Dodecahedron }
  227.   object { Unit_Octahedron scale <1.055643, 1.055643, 1.055643> }
  228.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  229. }
  230.  
  231. #declare Great_Rhombicuboctahedron =
  232. intersection {
  233.   object { Unit_Cube }
  234.   object { Rhombic_Dodecahedron scale <1.153010, 1.153010, 1.153010> }
  235.   object { Unit_Octahedron scale <1.092235, 1.092235, 1.092235> }
  236.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  237. }
  238.  
  239. #declare Small_Rhombicosidodecahedron =
  240. intersection {
  241.   object { Unit_Dodecahedron }
  242.   object { Rhombic_Triacontahedron scale <1.025894, 1.025894, 1.025894> }
  243.   object { Unit_Icosahedron scale <1.044417, 1.044417, 1.044417> }
  244.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  245. }
  246.  
  247. #declare Great_Rhombicosidodecahedron =
  248. intersection {
  249.   object { Unit_Dodecahedron }
  250.   object { Rhombic_Triacontahedron scale <1.085765, 1.085765, 1.085765> }
  251.   object { Unit_Icosahedron scale <1.065749, 1.065749, 1.065749> }
  252.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  253. }
  254.  
  255.  
  256. //PYRAMIDS REQUIRED TO CREATE SNUBS
  257.  
  258. #declare SnubSquarePyramid =
  259. intersection {
  260.   plane { -z, 0 rotate <37.016570, 0, 16.467560> } 
  261.   plane { -z, 0 rotate <37.016570, 0, 106.467560> }
  262.   plane { -z, 0 rotate <37.016570, 0, 196.467560> }
  263.   plane { -z, 0 rotate <37.016570, 0, 286.467560> }
  264.   pigment {color Orange}
  265.   translate -1.329949*z
  266. }
  267.  
  268. #declare SnubPentPyramid =
  269. intersection {
  270.   plane { -z, 0 rotate <27.070080, 0, 12.017840> }
  271.   plane { -z, 0 rotate <27.070080, 0, 84.017840> }
  272.   plane { -z, 0 rotate <27.070080, 0, 156.017840> }
  273.   plane { -z, 0 rotate <27.070080, 0, 228.017840> }
  274.   plane { -z, 0 rotate <27.070080, 0, 300.017840> }
  275.   pigment {color Orange}
  276.   translate -1.177550*z
  277. }
  278.  
  279.  
  280. //SNUBS
  281. //(For mirror image forms, scale <-1, 1, 1>)
  282.  
  283. #declare Snub_Cube =
  284. intersection {
  285.   object { Unit_Cube }
  286.   object { Unit_Octahedron scale <1.061913, 1.061913, 1.061913> }
  287.   object { SnubSquarePyramid }
  288.   object { SnubSquarePyramid rotate 90*y }
  289.   object { SnubSquarePyramid rotate 180*y }
  290.   object { SnubSquarePyramid rotate 270*y }
  291.   object { SnubSquarePyramid rotate 90*x } 
  292.   object { SnubSquarePyramid rotate -90*x }
  293.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  294. }
  295.  
  296. #declare Snub_Dodecahedron =
  297. intersection {
  298.   object { Unit_Dodecahedron }
  299.   object { Unit_Icosahedron scale <1.049627, 1.049627, 1.049627> }
  300.   object { SnubPentPyramid rotate 180*z rotate <-26.565051, 0, 0> }
  301.   object { SnubPentPyramid rotate 180*z rotate <-26.565051, 72, 0> }
  302.   object { SnubPentPyramid rotate 180*z rotate <-26.565051, 144, 0> }
  303.   object { SnubPentPyramid rotate 180*z rotate <-26.565051, 216, 0> }
  304.   object { SnubPentPyramid rotate 180*z rotate <-26.565051, 288, 0> }
  305.   object { SnubPentPyramid rotate <26.565051, 36, 0> }
  306.   object { SnubPentPyramid rotate <26.565051, 108, 0> }
  307.   object { SnubPentPyramid rotate <26.565051, 180, 0> }
  308.   object { SnubPentPyramid rotate <26.565051, 252, 0> }
  309.   object { SnubPentPyramid rotate <26.565051, 324, 0> }
  310.   object { SnubPentPyramid rotate -90*x }
  311.   object { SnubPentPyramid rotate 90*x }
  312.    bounded_by { sphere { < 0, 0, 0, >, 1.8 } }
  313. }
  314.  
  315.  
  316. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  317. // ADD A SCENE     
  318. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  319.  
  320. global_settings { assumed_gamma 2.2 }
  321.  
  322. camera {
  323.    location < 20.0, 20.0, -60.0 >
  324.    direction < 0.0, 0.0, 6.0 >
  325.    up < 0.0, 1.0, 0.0 >
  326. //   right < 1.33333, 0.0, 0.0 > 
  327.    right < 160/120, 0.0, 0.0 > 
  328.    look_at < 0.0, 0.0, 0.0 >
  329. }
  330.  
  331. light_source { < 100.0, 100.0, -100.0 > colour rgb 1 }
  332.  
  333. light_source { < -100.0, 0.0, -50.0 > colour rgb 0.5 }
  334.  
  335. object { Rhombic_Dodecahedron translate < -6.0, 3.0, 0.0 > }
  336. object { Rhombic_Triacontahedron translate < -3.0, 3.0, 0.0 > }
  337. object { Truncated_Tetrahedron translate <  0.0, 3.0, 0.0 > }
  338. object { Truncated_Cube translate <  3.0, 3.0, 0.0 > }
  339. object { Truncated_Octahedron translate <  6.0, 3.0, 0.0 > }
  340.  
  341. object { Cuboctahedron translate < -6.0, 0.0, 0.0 > }
  342. object { Truncated_Dodecahedron translate < -3.0, 0.0, 0.0 > }
  343. object { Truncated_Icosahedron translate <  0.0, 0.0, 0.0 > }
  344. object { Icosidodecahedron translate <  3.0, 0.0, 0.0 > }
  345. object { Small_Rhombicuboctahedron translate <  6.0, 0.0, 0.0 > }
  346.  
  347. object { Great_Rhombicuboctahedron translate < -6.0, -3.0, 0.0 > }
  348. object { Snub_Cube translate < -3.0, -3.0, 0.0 > }
  349. object { Snub_Dodecahedron translate <  0.0, -3.0, 0.0 > }
  350. object { Snub_Cube scale < -1, 1, 1 > translate <  3.0, -3.0, 0.0 > }
  351. object { Snub_Dodecahedron scale < -1, 1, 1 > translate <  6.0, -3.0, 0.0 > }
  352.